﻿@page "/wiki/wiki-detail/{id:long}"
@attribute [Authorize]
@inject IWikiService WikiService


<MRow NoGutters Style="padding: 8px;">
    @if (_wikiDetails?.Result != null || _wikiDetails?.Total != 0)
    {
        @foreach (var item in _wikiDetails.Result)
        {
            <MCol key="@item.Id" Cols=3 Style="margin: 5px;">
                
                <PModal Title="@item.Document_Id"
                        Width="950">
                    <ActivatorContent>
                        <MCard Elevation="1">
                            <div style="font-weight:bold;margin-left:8px;font-size:12px;padding:8px;">
                                @item.Document_Id
                            </div>
                            <div style="font-size:16px;white-space: pre-line;overflow: hidden;text-overflow: ellipsis;height:120px;font-size:12px;padding:5px;">
                                @item.Content
                            </div>
                            <MCardActions>
                                <MSpacer></MSpacer>
                                <MButton Small @attributes="@context.Attrs" Text>查看详情</MButton>
                                <MButton Small OnClick="()=>{}" Text>删除</MButton>
                            </MCardActions>
                        </MCard>
                    </ActivatorContent>
                    <ChildContent>
                        <div style="font-size:16px;white-space: pre-line;overflow:auto;text-overflow: ellipsis;height:70vh;font-size:14px;padding:5px;">
                            @item.Content
                        </div>
                    </ChildContent>
                </PModal>
            </MCol>
        }
    }
    else
    {
        <p style="font-size: 20px;text-align: center;color: darkgray;">
            暂无数据
        </p>
    }
</MRow>

<MPagination Value="page" ValueChanged="OnPageChanged" Class="my-4" Length=@((int)Math.Ceiling((double)_wikiDetails.Total / pageSize))></MPagination>